<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
    <title>社区商城</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        function viewComment(href){
            top.$.jBox.open('iframe:'+href,'查看评论',$(top.document).width()-220,$(top.document).height()-120,{
                buttons:{"关闭":true},
                loaded:function(h){
                    $(".jbox-content", top.document).css("overflow-y","hidden");
                    $(".nav,.form-actions,[class=btn]", h.find("iframe").contents()).hide();
                    $("body", h.find("iframe").contents()).css("margin","10px");
                }
            });
            return false;
        }
        function page(n,s){
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            $("#searchForm").submit();
            return false;
        }
    </script>
</head>
<body>
<ul class="nav nav-tabs">
    <li class="active"><a href="${ctx}/cms/cmsBusiness/?category.id=${cmsBusiness.category.id}&user.id=${cmsBusiness.user.id}">商城信息列表</a></li>
    <shiro:hasPermission name="cms:cmsBusiness:edit"><li><a href="<c:url value='${fns:getAdminPath()}/cms/cmsBusiness/form?id=${cmsBusiness.id}&category.id=${cmsBusiness.category.id}&user.id=${cmsBusiness.user.id}'><c:param name='category.name' value='${cmsBusiness.category.name}'/></c:url>">商城信息添加</a></li></shiro:hasPermission>
</ul>
<form:form id="searchForm" modelAttribute="cmsBusiness" action="${ctx}/cms/cmsBusiness/" method="post" class="breadcrumb form-search">
    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
    <label>栏目：</label><sys:treeselect id="category" name="category.id" value="${cmsBusiness.category.id}" labelName="category.name" labelValue="${cmsBusiness.category.name}"
                                      title="栏目" url="/cms/category/treeData" module="cmsBusiness" notAllowSelectRoot="false" cssClass="input-small"/>
    <label>商品名称：</label><form:input path="name" htmlEscape="false" maxlength="50" class="input-small"/>&nbsp;
    <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>&nbsp;&nbsp;
</form:form>
<sys:message content="${message}"/>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
    <thead><tr><th>商品名称</th><th>商品价格</th><th>简介</th><th>店铺地址</th><th>联系电话</th><th>手机</th><th>更新时间</th><th>操作</th></tr></thead>
    <tbody>
    <c:forEach items="${page.list}" var="cmsBusiness">
        <tr>
            <td>${cmsBusiness.name}</td>
            <td>${cmsBusiness.price}￥</td>
            <td>${cmsBusiness.description}</td>
            <td>${cmsBusiness.address}</td>
            <td>${cmsBusiness.phone}</td>
            <td>${cmsBusiness.mobile}</td>
            <td><fmt:formatDate value="${cmsBusiness.updateDate}" type="both"/></td>
            <td>
                <shiro:hasPermission name="cms:cmsBusiness:edit">
                    <a href="${ctx}/cms/cmsBusiness/form?id=${cmsBusiness.id}">修改</a>
                    <shiro:hasPermission name="cms:cmsBusiness:audit">
                        <a href="${ctx}/cms/cmsBusiness/delete?id=${cmsBusiness.id}${cmsBusiness.delFlag ne 0?'&isRe=true':''}" onclick="return confirmx('确认要${cmsBusiness.delFlag ne 0?'发布':'删除'}该信息吗？', this.href)" >${cmsBusiness.delFlag ne 0?'发布':'删除'}</a>
                    </shiro:hasPermission>
                </shiro:hasPermission>
            </td>
        </tr>
    </c:forEach>
    </tbody>
</table>
<div class="pagination">${page}</div>
</body>
</html>